﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SDT.Lib.Paging;
using SDT.Model;
using System.Web.UI.WebControls;
using SDT.Systems;
using System.Web.Mvc;

namespace SDT.Admin.ViewModels
{
    /// <summary>
    /// Author: Takamaru Nguyen
    /// Date: 12/08/2011
    /// </summary>
    public class MailViewModels
    {
        public IPagedList<Mail> Mails;
        public int? CurrentPubStatus;
        public string Keyword;
        public List<SelectListItem> ListStatusPub
        {
            get
            {
                List<SelectListItem> list = new CommonType().ToList();
                if (this.CurrentPubStatus.HasValue)
                    list.SingleOrDefault(i => int.Parse(i.Value) == this.CurrentPubStatus.Value).Selected = true;

                return list;
            }
        }
    }

    /// <summary>
    /// Author: Takamaru Nguyen
    /// Date: 12/08/2011
    /// </summary>
    public class MailInputModels
    {
        public Mail Mail{ get; set; }
        public List<MailCategory> Categories { get; set; }
        public List<int> CatID
        {
            get;
            set;
        }
    }
    public class MailIndexViewModels
    {
        public IPagedList<Mail> Mails { get; set; }
        public string Keyword { get; set; }
        public int CategoryID { get; set; }
        public List<MailCategory> Categories { get; set; }
    }
}
